home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / NET / IRDA / IRIAP.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  112 lines

  1. /*********************************************************************
  2.  *                
  3.  * Filename:      iriap.h
  4.  * Version:       0.5
  5.  * Description:   Information Access Protocol (IAP)
  6.  * Status:        Experimental.
  7.  * Author:        Dag Brattli <dagb@cs.uit.no>
  8.  * Created at:    Thu Aug 21 00:02:07 1997
  9.  * Modified at:   Mon Mar 22 13:15:04 1999
  10.  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  11.  * 
  12.  *     Copyright (c) 1997 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
  13.  *     
  14.  *     This program is free software; you can redistribute it and/or 
  15.  *     modify it under the terms of the GNU General Public License as 
  16.  *     published by the Free Software Foundation; either version 2 of 
  17.  *     the License, or (at your option) any later version.
  18.  *
  19.  *     Neither Dag Brattli nor University of Troms° admit liability nor
  20.  *     provide warranty for any of this software. This material is 
  21.  *     provided "AS-IS" and at no charge.
  22.  *
  23.  ********************************************************************/
  24.  
  25. #ifndef IRIAP_H
  26. #define IRIAP_H
  27.  
  28. #include <linux/types.h>
  29. #include <linux/skbuff.h>
  30.  
  31. #include <net/irda/qos.h>
  32. #include <net/irda/iriap_event.h>
  33. #include <net/irda/irias_object.h>
  34. #include <net/irda/irqueue.h>
  35. #include <net/irda/timer.h>
  36.  
  37. #define IAP_LST 0x80
  38. #define IAP_ACK 0x40
  39.  
  40. #define IAS_SERVER 0
  41. #define IAS_CLIENT 1
  42.  
  43. /* IrIAP Op-codes */
  44. #define GET_INFO_BASE      0x01
  45. #define GET_OBJECTS        0x02
  46. #define GET_VALUE          0x03
  47. #define GET_VALUE_BY_CLASS 0x04
  48. #define GET_OBJECT_INFO    0x05
  49. #define GET_ATTRIB_NAMES   0x06
  50.  
  51. #define IAS_SUCCESS        0
  52. #define IAS_CLASS_UNKNOWN  1
  53. #define IAS_ATTRIB_UNKNOWN 2
  54.  
  55. typedef void (*CONFIRM_CALLBACK)( __u16 obj_id, struct ias_value *value,
  56.                   void *priv);
  57.  
  58. struct iriap_cb {
  59.     QUEUE queue; /* Must be first */
  60.     
  61.     int          magic;  /* Magic cookie */
  62.     int          mode;   /* Client or server */
  63.  
  64.     __u32        saddr;
  65.     __u32        daddr;
  66.     __u8         operation;
  67.  
  68.     struct sk_buff *skb;
  69.     struct lsap_cb *lsap;
  70.     __u8 slsap_sel;
  71.  
  72.     /* Client states */
  73.     IRIAP_STATE client_state;
  74.     IRIAP_STATE call_state;
  75.     
  76.     /* Server states */
  77.     IRIAP_STATE server_state;
  78.     IRIAP_STATE r_connect_state;
  79.     
  80.     CONFIRM_CALLBACK confirm;
  81.     void *priv;
  82.  
  83.     struct timer_list watchdog_timer;
  84. };
  85.  
  86. int  iriap_init(void);
  87. void iriap_cleanup(void);
  88. void iriap_getvaluebyclass_request( char *name, char *attr, 
  89.                     __u32 saddr, __u32 daddr,
  90.                     CONFIRM_CALLBACK callback, void *priv);
  91. void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb);
  92.  
  93. void iriap_send_ack( struct iriap_cb *self);
  94. void iriap_connect_confirm(void *instance, void *sap, struct qos_info *qos, 
  95.                __u32 max_sdu_size, struct sk_buff *skb);
  96. void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
  97.  
  98. void iriap_register_server(void);
  99.  
  100. void iriap_watchdog_timer_expired( unsigned long data);
  101.  
  102. static inline void iriap_start_watchdog_timer( struct iriap_cb *self, 
  103.                            int timeout) 
  104. {
  105.     irda_start_timer( &self->watchdog_timer, timeout, 
  106.               (unsigned long) self, iriap_watchdog_timer_expired);
  107. }
  108.  
  109. #endif
  110.  
  111.  
  112.